<html>
	<body>
		<div class="page-header">
			<h1> <font color="blue">Home page</font></h1>
		</div>
		<div align="center" class="table-responsive">
			<table class="table table-hover">
    			<tr class="info">
        			<th><font color="blue">ID</font></th>
        			<th><font color="blue">Title</font></th>
        			<th><font color="blue">Actions</font></th>
        			<th><font color="blue">Created</font></th>
    			</tr>
    			<?php foreach ($posts as $post): ?>
				<tr>
					<td><?php echo $post['Post']['id']; ?></td>
        			<td>
            			<?php echo $this->Html->link($post['Post']['title'],
            					array('controller' => 'posts', 'action' => 'view', $post['Post']['id'])); ?>
        			</td>
        			<td>
	            			<?php
	                			echo $this->Html->link('Edit', 
									array('action' => 'edit', $post['Post']['id'])
	                			);
	            			?>
	            			&nbsp;&nbsp;
	            			<?php
	                			echo $this->Form->postLink('Delete',
									array('action' => 'delete', $post['Post']['id']),
	                    			array('confirm' => 'Are you sure?')
	                			);
	            			?>
        			</td>
        			<td><?php echo $post['Post']['created']; ?></td>
    			</tr>
    			<?php endforeach; ?>
    			<?php unset($post); ?>
			</table>
		</div>
		<div align="right">
			<a href="/posts/add" class="btn btn-primary" style="width: 200px">Add new post</a>
		</div>
		<br>
	</body>
</html>

